<?php

namespace common\models\shop;

use Yii;

/**
 * This is the model class for table "shop".
 *
 * @property int $id
 * @property string $name 名称
 * @property int $status 状态【-1删除、0禁用、1正常】
 * @property int $created_at 创建时间
 * @property int $updated_at 更新时间
 */
class Shop extends \common\models\base\BaseModel
{
    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 失效
    const STATUS_ENABLE = 1;// 正常

    public static $statuss = [
        self::STATUS_DELETE => '删除',
        self::STATUS_INVALID => '禁用',
        self::STATUS_ENABLE => '正常',
    ];

    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'shop';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['status', 'created_at', 'updated_at'], 'integer'],
            [['name'], 'string', 'max' => 32],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => '名称',
            'status' => '状态【-1删除、0禁用、1正常】',
            'created_at' => '创建时间',
            'updated_at' => '更新时间',
        ];
    }
}
